<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
<f:view>
	<h:head>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<h:outputStylesheet library="css" name="style.css" />
	</h:head>
	<h:body>
		<h:form id="corps" style="height:100%;width:100%;">
			<h:commandLink action="#{ObjetEleve.vue.retourAcceuil()}"
				title="INGEBOOK - THE INGESUP'S SOCIAL NETWORK">
				<h:panelGroup styleClass="banniere" layout="block" rendered="true" />
			</h:commandLink>
			<hr />
			<h:panelGroup id="contenu" styleClass="content" layout="block"
				rendered="true">
				<h:panelGroup styleClass="entete" id="entete" layout="block">
					<h:graphicImage id="image" styleClass="photoProfil"
						value="image?id=#{ObjetEleve.vue.photoProfil}" style="float:left;"
						rendered="true">
					</h:graphicImage>
					<h:panelGroup id="name" styleClass="infosEntete" layout="block"
						rendered="true">
						<h:panelGroup id="logout" layout="block">
							<h:commandButton styleClass="deconnect"
								action="#{ObjetEleve.vue.deconnexion()}" />
						</h:panelGroup>
						<h:panelGroup id="nometprenom" layout="block">
							<h:outputText style="font-size: 200%;"
								value="#{ObjetEleve.vue.nom_eleve} #{ObjetEleve.vue.prenom_eleve} #{ObjetEleve.vue.classeEleve.nom_classe}">
							</h:outputText>
						</h:panelGroup>
					</h:panelGroup>
				</h:panelGroup>
				<h:panelGroup id="body" layout="block">
					<h:panelGroup id="menu" styleClass="menu" layout="block"
						rendered="true">
						<rich:collapsiblePanel header="Ajouter une photo !"
							expanded="false" styleClass="menu_item">
							<h:panelGroup id="photo" layout="block">
								<h:panelGroup id="ajouterPhoto" layout="block" rendered="true">
									<p>
										<rich:fileUpload styleClass="fileUpload" listHeight="70px"
											immediateUpload="true"
											fileUploadListener="#{ObjetEleve.vue.listener}"
											value="#{ObjetEleve.vue.photoProfil}"
											uploadData="#{ObjetEleve.vue.photoProfil}"
											acceptedTypes="jpg, png, gif" maxFilesQuantity="1"
											render="image" />
									</p>
									<h:selectBooleanCheckbox value="#{ObjetEleve.vue.asProfil}">Photo de profil</h:selectBooleanCheckbox>
								</h:panelGroup>
							</h:panelGroup>
						</rich:collapsiblePanel>
						<rich:collapsiblePanel header="Rechercher un ami"
							switchType="client" expanded="false" styleClass="menu_item">
							<a4j:outputPanel id="searchFriend" layout="block">
								<h:form>
									<h:panelGroup layout="block" rendered="true">
										<h:outputText value="Trouver des amis grâce à leur nom : " />
									</h:panelGroup>
									<a4j:outputPanel layout="block" rendered="true">
										<h:inputText value="#{ObjetEleve.vue.nomRechercheAmi}" />
										&nbsp;
										<h:commandButton id="rechercher" styleClass="rechercher"
											onclick="#{ObjetEleve.vue.rechercherAmi()}">
										</h:commandButton>
									</a4j:outputPanel>
									<h:panelGroup layout="block" rendered="true">
										<a4j:repeat value="#{ObjetEleve.vue.listElevesRechercheAmi}"
											var="eleveRechercheAmi">
											<a4j:outputPanel layout="block" rendered="true">
												<p>
													<rich:componentControl event="click" target="popup"
														operation="show" />
													<h:graphicImage url="plus-icon.png" />
													<h:outputText
														value="#{eleveRechercheAmi.nom_eleve} #{eleveRechercheAmi.prenom_eleve} " />
													<h:graphicImage styleClass="photoRechercheAmi"
														value="image?id=#{eleveRechercheAmi.photoProfil}" />
													<rich:popupPanel id="popup" modal="true" autosized="true"
														domElementAttachment="form" resizeable="false"
														onmaskclick="#{rich:component('popup')}.hide()">

														<f:facet name="header">
															<h:outputText value="Confirmation ajout ami" />
														</f:facet>
														<f:facet name="controls">
															<h:outputLink value="#"
																onclick="#{rich:component('popup')}.hide(); return false;">
                X
            </h:outputLink>
														</f:facet>
														<p>Etes vous sur de vouloir ajouter cette personne en
															ami ?</p>
														<h:form>

															<h:panelGroup layout="block">
																<h:inputHidden value="#{amiBean.id_eleve_ajout}" />
																<h:outputText value="#{eleveRechercheAmi.nom_eleve} " />
																<h:outputText value="#{eleveRechercheAmi.prenom_eleve}" />
																&nbsp;&nbsp;
																<h:graphicImage styleClass="photoPopUp"
																	value="image?id=#{eleveRechercheAmi.photoProfil}" />
															</h:panelGroup>
															<a4j:commandButton action="#{amiBean.save()}"
																oncomplete="#{rich:component('popup')}.hide(); return false;"
																render="listeAmis">
																<a4j:param value="#{eleveRechercheAmi.id_eleve}"
																	assignTo="#{amiBean.id_eleve_ajout}" />
																<a4j:param value="#{ObjetEleve.vue.id_eleve}"
																	assignTo="#{amiBean.id_eleve_courant}" />
															</a4j:commandButton>
															&nbsp;&nbsp;
															<a4j:commandButton
																onclick="#{rich:component('popup')}.hide(); return false;" />
														</h:form>
													</rich:popupPanel>

												</p>
											</a4j:outputPanel>
										</a4j:repeat>
									</h:panelGroup>
								</h:form>
							</a4j:outputPanel>
						</rich:collapsiblePanel>
						<rich:collapsiblePanel header="Liste d'amis" switchType="client"
							expanded="true" styleClass="menu_item">
							<h:panelGroup id="listeAmis" layout="block">
								<h:form>
									<b> <h:outputText value="LISTE D'AMIS" />
									</b>
									<h:dataTable value="#{ObjetEleve.vue.listeAmis}" var="ami">
										<h:column>
											<a4j:commandLink action="#{ObjetEleve.vue.vueAmi()}">
												<a4j:param value="#{ami.id_eleve}"
													assignTo="#{ObjetEleve.vue.id_eleve_vue}" />
												<h:outputText value="#{ami.nom_eleve} "
													style="display:inline; width:5%" />
												<h:outputText value="#{ami.prenom_eleve}" />
											</a4j:commandLink>
										</h:column>
										<h:column>
											<h:graphicImage styleClass="photoListeAmi"
												value="image?id=#{ami.photoProfil}" />
										</h:column>
									</h:dataTable>
								</h:form>
							</h:panelGroup>
						</rich:collapsiblePanel>
						<rich:collapsiblePanel header="Mes groupes" expanded="false"
							styleClass="menu_item">
							<h:panelGroup id="groupes" layout="block">
							</h:panelGroup>
						</rich:collapsiblePanel>
					</h:panelGroup>
					<h:panelGroup id="wall" styleClass="wall" layout="block">
						<rich:tabPanel switchType="client">
							<rich:tab header="Mur" style="vertical-align: middle;"
								styleClass="panelItem">
								<a4j:outputPanel id="panelMonActu">
									<a4j:outputPanel id="monActu"
										rendered="#{(ObjetEleve.vue.displayModifications) ? false : true}"
										layout="block">
										<b> <h:outputText value="ACTU" />
										</b>
										<p>
											<h:outputText value="Aucune actualité n'a été publiée"
												rendered="#{ObjetEleve.vue.listePublications.size() == 0}" />
										</p>
										<a4j:repeat id="listActu" var="msg"
											value="#{ObjetEleve.vue.listePublications}">
											<p>
												<a4j:outputPanel styleClass="message" layout="block">
													<h:outputText value="${msg}" escape="false" />
												</a4j:outputPanel>
											</p>
										</a4j:repeat>
									</a4j:outputPanel>
								</a4j:outputPanel>
							</rich:tab>
							<rich:tab header="Messages privés"
								style="vertical-align: middle;" styleClass="panelItem">
								<a4j:outputPanel>
									<p>
										<h:outputText value="Ecrivez lui "></h:outputText>
									</p>
									<a4j:outputPanel id="ecrireMessageMur" layout="block"
										styleClass="formulaireAjoutMessage">
										<ui:include src="includeMessagePrive.xhtml"></ui:include>
									</a4j:outputPanel>
								</a4j:outputPanel>
							</rich:tab>
							<rich:tab header="L'actualité de ma classe"
								styleClass="panelItem">
								<b><h:outputText
										value="L'ACTU DE LA #{ObjetEleve.vue.classeEleve.nom_classe}" /></b>
							</rich:tab>
						</rich:tabPanel>
					</h:panelGroup>
				</h:panelGroup>
			</h:panelGroup>
		</h:form>
	</h:body>
</f:view>
</html>
